/*
Java source file
Copyright: David Leeb 2011
*/
package com.david.documentation.service.scheduler;

import com.david.documentation.service.category.CategoryService;
import com.david.documentation.service.doku.DokuService;
import com.david.documentation.service.link.LinkService;
import com.david.documentation.service.parser.DokuJunkiesParserServiceImpl;
import com.david.documentation.service.tag.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service(value = "parserSchedulerService")
@Transactional(rollbackFor = Exception.class)
public class ParserSchedulerServiceImpl implements ParserSchedulerService {

	@Autowired
	private DokuService dokuService;

	@Autowired
	private LinkService linkService;

	@Autowired
	private CategoryService categoryService;

	@Autowired
	private TagService tagService;


    @Scheduled(cron = "0 3 0 * * ?")
    public void runParser() {
        System.out.println("--- START PARSERSERVICES ---");
		DokuJunkiesParserServiceImpl service = new DokuJunkiesParserServiceImpl(dokuService,linkService,categoryService,tagService);
		service.parse();
        System.out.println("--- END PARSERSERVICES ---");
    }


}
